﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AspDataBinding
{
    public partial class EmployeesDetails : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            NorthwindDataContext context = new NorthwindDataContext();
            var empNames =
                from em in context.Employees
                select new { name = em.FirstName + " " + em.LastName,EmployeeID=em.EmployeeID };
            this.GridViewEmployees.DataSource = empNames;
            this.GridViewEmployees.DataBind();
        }
    }
}